/*
 * MyController.java
 * Feb 12, 2013 
 */
package com.jramoyo.controller;

import java.security.Principal;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author jramoyo
 */
@Controller
public class MyController {

	@RequestMapping(value = "/", method = RequestMethod.GET)
	public String getHomePage(Principal principal, Model model) {
		if (principal != null) {
			model.addAttribute("username", principal.getName());
		}

		return "index";
	}
}
